package com.zuoye.zuoye1;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

public class Test {
    public static void main(String[] args) {
        ArrayList<Student> list = new ArrayList<>();

        list.add(new Student("张三", 16, 175));
        list.add(new Student("李三", 19, 160));
        list.add(new Student("王三", 17, 180));
        list.add(new Student("赵三", 18, 165));
        list.add(new Student("小三", 16, 170));
        Collections.sort(list);
        list.forEach(System.out::println);
      /*  list.sort(new Comparator<Student>() {
            @Override
            public int compare(Student o1, Student o2) {
                if (o1.getAge() == o2.getAge()){
                    return Double.compare(o2.getHight(), o1.getHight());
                }
                return o1.getAge() - o2.getAge();
            }
        });

       */






    }
}
